//
//  DingDanView.swift
//  RoundCatPlay2
//
//  Created by 姜澎 on 2019/10/29.
//  Copyright © 2019 jiangpeng. All rights reserved.
//

import UIKit

class DingDanView: UIImageView {

    //    在线时间
    public lazy var timeLable: UILabel = {
        var t = UILabel(frame: CGRect(x: 30, y: 10, width: 100, height: 20))
        t.font = UIFont.systemFont(ofSize: 14)
        t.text = "在线/1小时前"
        t.textColor = .white
        return t
    }()
    //    addressImage
    private lazy var addressImage :UIImageView = {
        let i = UIImageView(frame: CGRect(x: 30, y: 45, width: 20, height: 20))
        i.image = UIImage(named: "dw")
        i.contentMode = .scaleAspectFit
        return i
    }()
    //    addressName
    private lazy var addressName: UILabel = {
        let l = UILabel(frame: CGRect(x: 55, y: 40, width: 40, height: 30))
        l.textColor = .white
        l.text = "北京"
        l.font = UIFont.systemFont(ofSize: 14)
        return l
    }()
    
    //    性别
    private lazy var xbAge:UILabel = {
        let l = UILabel(frame: CGRect(x: 95, y: 47, width: 40, height: 15))
        l.text = "♀21"
        l.textColor = .white
        l.backgroundColor = UIColor(red: 245/255, green: 68/255, blue: 100/255, alpha: 1)
        l.clipsToBounds = true
        l.layer.cornerRadius = 4
        l.font = UIFont.systemFont(ofSize: 14)
        l.textAlignment = .center
        return  l
    }()
    
    private lazy var listImage:UIImageView = {
        let i = UIImageView(frame: CGRect(x: Int(UIScreen.main.bounds.width - 170), y: 45, width: 20, height: 20))
        i.image = UIImage(named: "list")
        i.contentMode = .scaleAspectFit
        return i
    }()
    
    //    单数
    private lazy var listNum:UILabel = {
        let i = UILabel(frame: CGRect(x: Int(UIScreen.main.bounds.width - 170 + 20 + 10), y: 50, width: 40, height: 10))
        i.text = "24单"
        i.textColor = .white
        i.font = UIFont.systemFont(ofSize: 14)
        return i
    }()
    
    //    赞
    private lazy var zanImage:UIImageView = {
        let i = UIImageView(frame: CGRect(x: Int(UIScreen.main.bounds.width - 170 + 20 + 10 + 40 + 10), y: 43, width: 20, height: 20))
        i.contentMode = .scaleAspectFit
        i.image = UIImage(named: "zan")
        return i
    }()
    
    //    分数
    private lazy var fs:UILabel = {
        let l = UILabel(frame: CGRect(x: Int(UIScreen.main.bounds.width - 170 + 20 + 10 + 40 + 10 + 20 + 10), y: 50, width: 40, height: 10))
        l.text = "8分"
        l.textColor = .white
        l.font = UIFont.systemFont(ofSize: 14)
        return l
    }()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        image = UIImage(named: "mbl")
        addSubview(self.timeLable)
        addSubview(self.addressImage)
        addSubview(self.addressName)
        addSubview(self.xbAge)
        addSubview(self.listImage)
        addSubview(self.listNum)
        addSubview(self.fs)
        addSubview(self.zanImage)
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}

